<?php
namespace Shopiuu\Model;

use Shopiuu\Http\RequestCore;

class StoreTheme extends Model{
    
    public function __construct($accessToken, $endpoint)
    {
        parent::__construct($accessToken, $endpoint);
    }

    /**
     * Get store themes
     * @return ResponseCore
     */
    public function getList()
    {
        $request = $this->getRequest('/openApi/storeTheme/lists');
        $result = $request->set_method('GET')->send_request(true);
        return $result;
    }

    /**
     * Get store theme files
     * @return ResponseCore
     */
    public function getThemeFiles($params)
    {
        $request = $this->getRequest('/openApi/storeTheme/getThemeFiles');
        $result = $request->set_body(json_encode($params))->set_method('POST')->send_request(true);
        return $result;
    }

    /**
     * Get store theme files
     * @return ResponseCore
     */
    public function createTheme($params)
    {
        $request = $this->getRequest('/openApi/storeTheme/createTheme');
        $result = $request->set_body(json_encode($params))->set_method('POST')->send_request(true);
        return $result;
    }
    
    /**
     * Delete store theme
     * @param array $params array("id"=>"25")
     * @return ResponseCore
     */
    public function delete($params)
    {
        $request = $this->getRequest('/openApi/storeTheme/delete');
        $result = $request->set_body(json_encode($params))->set_method('POST')->send_request(true);
        return $result;
    }

}